import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function playerList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createPlayer(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}

export function deletePlayer(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}

export function deleteUser(id) {
  return request({
    url: `/chinasoccer/userdelete/${id}`,
    method: 'delete'
  })
}

export function userList(query) {
  return request({
    url: '/chinasoccer/alluser',
    method: 'get',
    params: query
  })
}

export function updateUser(data) {
  return request({
    url: `/chinasoccer/userinfo`,
    method: 'put',
    data
  })
}

export function InjuryList(query) {
  return request({
    url: '/chinasoccer/injury',
    method: 'get',
    params: query
  })
}

export function updateTeamFormation(query, data) {
  return request({
    url: '/chinasoccer/teamformation_data',
    method: 'post',
    params: query,
    data
  })
}
